/*
   @Copyright:LibreOJ
   @Author:   tjyemail
   @Problem:  https://loj.ac/problem/100
   @Language: C++
   @Datetime: 20-07-31 17:07
   */
// fread+avx - time 236ms
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define MAX 505
int A[MAX][MAX], B[MAX][MAX];

typedef int _FR_TYPE;
char _FR_BUF[102400];
struct _FR {
	char *buf, sign;
	size_t size, block, idx, end;
	_FR_TYPE num;
	_FR(char *_buf, size_t _size, size_t _block):buf(_buf), size(_size), block(_block){idx=end=size;}
	inline _FR_TYPE read() {
		if (idx > size - block && end == size) {
			memmove(buf, buf + idx, end - idx);
			end = size - idx + fread(buf + size - idx, 1, idx, stdin);
			idx = 0;
		}
		for (num=0; isspace(buf[idx]); ++idx);
		sign = buf[idx]!='-'?'0':buf[idx++];
		for (; isdigit(buf[idx]); ++idx)
			num = num * 10 + buf[idx] - '0';
		return sign!='-'?num:-num;
	}
} fr(_FR_BUF, sizeof(_FR_BUF), 16);

inline void load(int M[MAX][MAX], int row, int col) {
	for(int i=0; i<row; ++i)
		for(int j=0; j<col; ++j)
			M[i][j]= fr.read();
}

int main()
{
	int n, p, m;
	scanf("%d %d %d", &n, &p, &m);
	load(A, n, p);
	load(B, p, m);
	char *pbuf;
	for(int i=0; i<n; ++i) {
		pbuf=_FR_BUF;
		for(int j=0; j<m; ++j) {
			long long c=0;
			int k=0;
			for(k=0; k+7<p; k+=8) {
				c +=(1LL*A[i][k]*B[k][j]
					+1LL*A[i][k+1]*B[k+1][j]
					+1LL*A[i][k+2]*B[k+2][j]
					+1LL*A[i][k+3]*B[k+3][j]
					+1LL*A[i][k+4]*B[k+4][j]
					+1LL*A[i][k+5]*B[k+5][j]
					+1LL*A[i][k+6]*B[k+6][j]
					+1LL*A[i][k+7]*B[k+7][j])%MOD;
			}
			for(; k<p; ++k)
				c += 1LL*A[i][k]*B[k][j];
			pbuf += sprintf(pbuf, "%lld ", (c%MOD+MOD)%MOD);
		}
		printf("%s\n", _FR_BUF);
	}
	return 0;
}
